import java.util.Arrays;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * 测试大根堆
 */
public class TestBigHeap {

    public static void main(String[] args) {
        BigHeap bigHeap = new BigHeap();
        int[] arr = {3, 7, 4, 2, 1, 8, 9, 10, 5};
        System.out.println("原数组: " + Arrays.toString(arr));
        bigHeap.creadHeap(arr);
        System.out.print("构造成大顶堆: ");
        bigHeap.showHeap();
        System.out.println("offer 一个 99");
        bigHeap.offer(99);
        System.out.print("构造成大顶堆: ");
        bigHeap.showHeap();
        int pop = bigHeap.pop();
        System.out.print(pop + "出堆, 此时堆: ");
        bigHeap.showHeap();
        // 堆排序
        bigHeap.heapSort();
    }
}
